//
//  TryHoneLogHelper.h
//  TryHone
//
//  Created by TryHone on 17/5/24.
//  Copyright © 2017年 TryHone. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, LogType) {
    LogType_Console = 0,
    LogType_File = 1
};


@interface JFLogModel : NSObject
@property (nonatomic,copy)NSString *txtLog;
@property (nonatomic,copy) NSDictionary *dictLog;
@property (nonatomic,assign) BOOL istxt;
@property (nonatomic,assign) BOOL  isDealWith;//是否在处理
@property (nonatomic,assign) LogType type;
@end

@interface JFLogHelper : NSObject
- (void)writeLog:(JFLogModel*)model;
@property(nonatomic,assign) BOOL isDebug;
#pragma mark--类方法，不建议外部使用
+ (JFLogHelper *)shareInstance;
+ (void)writeLog:(JFLogModel*)model;
//获取日志缓存目录
+ (NSString*)logCachePath;
//清除硬盘上的日志缓存
+ (void)clearDiskCacheFile;
//清除所有的缓存
+ (void)clearAllLogCache;

/**
 *  @author Alan, 16-12-23 17:12:36
 *
 *  @brief 把字符串写进日志文件
 *
 *  @param str 字符串
 */
+ (void)stringWriteLogToFile:(NSString*)str;
/**
 *  @author Alan, 16-12-23 17:12:07
 *
 *  @brief 把字典写进文件
 *
 *  @param dict 字典
 */
+ (void)mapWriteLogToFile:(NSDictionary*)dict;
/**
 *  @author Alan, 16-12-23 17:12:07
 *
 *  @brief 把数据写入到文件
 *
 *  @param data map str dict
 */
+ (void)dataWriteLogToFile:(id)data;

/**
 *  @author Alan, 16-12-23 17:12:46
 *
 *  @brief 异步把字符串输出到控制台 顺序不确定
 *
 *  @param str 字符串
 */
+ (void)stringWriteLogToConsole:(NSString*)str;
/**
 *  @author Alan, 16-12-26 13:12:02
 *
 *  @brief 异步把字典写入到控制台  顺序不确定
 *
 *  @param dict 字典入参
 */
+ (void)mapWriteLogToConsole:(NSDictionary*)dict;

/**
 *  @author Alan, 16-12-23 17:12:46
 *
 *  @brief 同步把字符串输出到控制台 顺序确定
 *
 *  @param str 字符串
 */
+ (void)stringSyncWriteLogToConsole:(NSString*)str;
/**
 *  @author Alan, 16-12-26 13:12:02
 *
 *  @brief 同步把字典写入到控制台 顺序确定
 *
 *  @param dict 字典入参
 */
+ (void)mapSyncWriteLogToConsole:(NSDictionary*)dict;

//向控制台写日志
+ (void)logToConsole:(id)data;
//同步向控制台写日志
+ (void)syncLogToConsole:(id)data;
//向控制台写日志
+ (void)logToFile:(id)data;

//上传日志 date 日期 2019-11-25 nil就上传当天日志
+ (void)uploadLogWithDate:(NSString*)date result:(void (^)(NSError * error))result;
@end
